﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="t_acntmasterform.aspx.cs" Inherits="RTGS.Web.form.rtgs.form_t_acntmasterform" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Role Form</title>
    <link href="<%= ResolveClientUrl("~/css/jquery.validate.error.css") %>" rel="stylesheet"
        type="text/css" />
    <script src="<%= ResolveClientUrl("~/script/helper.js") %>" type="text/javascript"></script>
    <script src="<%= ResolveClientUrl("~/script/jquery.validate.min.js") %>" type="text/javascript"></script>
    <script src="<%= ResolveClientUrl("~/script/jquery.validate.wrapper.js") %>" type="text/javascript"></script>
    <script type="text/javascript">

        $(document).ready(function () {

            $("#save").click(function () {
                var handlerUrl = '<%= ResolveClientUrl("~/ajaxhandler/rtgs/t_acntmaster.ashx") %>';
                var accountNo = encodeURIComponent($('#<%=txtAccountNo.ClientID %>').val());
                var status = encodeURIComponent($('#<%=txtStatus.ClientID %>').val());
                var accountName = encodeURIComponent($('#<%=txtAccountName.ClientID %>').val());

                var id = $('#<%= hfID.ClientID %>').val();

                var param = '&accountNo=' + accountNo + '&status=' + status + '&accountName=' + accountName;

                if (id == 0)
                    CallAjax(handlerUrl, "?method=insert&" + param);
                else
                    CallAjax(handlerUrl, "?method=update&" + param + "&id=" + id);

                parent.$('#dialog').dialog("close");
                setTimeout("parent.$('#table').trigger('reloadGrid');", 3000);
                return false;
            });
        });
    
    </script>
    <script type="text/javascript">
        function ClearText() {

            $('#txtDesc').val('');
        }

        $('#close').click(function () {
            parent.$('#dialog').dialog("close");
        });
    </script>
</head>
<body onload="ClearText();">
    <form id="form1" runat="server">
    <table border="0">
        <tr>
            <td style="width: 50">
                Account No
            </td>
            <td>
                :
            </td>
            <td>
                <asp:TextBox ID="txtAccountNo" MaxLength="10" runat="server" Width="300"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td style="width: 50">
                Status
            </td>
            <td>
                :
            </td>
            <td>
                <asp:TextBox MaxLength="1" ID="txtStatus" runat="server" Width="300"></asp:TextBox>
            </td>
        </tr>
            <tr>
            <td style="width: 50">
                Account Name
            </td>
            <td>
                :
            </td>
            <td>
                <asp:TextBox MaxLength="40" ID="txtAccountName" runat="server" Width="300"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                &nbsp;
            </td>
            <td>
                <div style="text-align: right; padding-top: 10px;">
                    <a href="#" id="save" class="dialog_link ui-state-default ui-corner-all" alt="Save">
                        <span class="ui-icon ui-icon-disk"></span>Save</a> <a href="#" id="close" class="dialog_link ui-state-default ui-corner-all"
                            alt="Close" onclick="parent.$('#dialog').dialog('close');"><span class="ui-icon ui-icon-close">
                            </span>Close</a>
                </div>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                &nbsp;
            </td>
            <td>
                <asp:HiddenField ID="hfID" runat="server" />
            </td>
        </tr>
    </table>
    </form>
</body>
</html>

